package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	WorkCode string `gorm:"type:varchar(30);not null"`
	Password string `gorm:"type:char(32);not null"`
}

func (u *User) FirstUserByWorker(db *gorm.DB, code string) error {
	return db.Debug().Where("work_code=?", code).First(u).Error
}
